Optimal. Leaf size=117 \[ \frac {a^2 c^2 (A+B) \cos ^5(e+f x)}{f (c-c \sin (e+f x))^3}+\frac {3 a^2 (2 A+3 B) \cos (e+f x)}{2 c f}+\frac {a^2 (2 A+3 B) \cos ^3(e+f x)}{2 f (c-c \sin (e+f x))}-\frac {3 a^2 x (2 A+3 B)}{2 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.139, Rules used = {2967, 2859, 2679, 2682, 8} \[ \frac {a^2 c^2 (A+B) \cos ^5(e+f x)}{f (c-c \sin (e+f x))^3}+\frac {3 a^2 (2 A+3 B) \cos (e+f x)}{2 c f}+\frac {a^2 (2 A+3 B) \cos ^3(e+f x)}{2 f (c-c \sin (e+f x))}-\frac {3 a^2 x (2 A+3 B)}{2 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2679
Rule 2682
Rule 2859
Rule 2967
Rubi steps
\begin {align*} \int \frac {(a+a \sin (e+f x))^2 (A+B \sin (e+f x))}{c-c \sin (e+f x)} \, dx &=\left (a^2 c^2\right ) \int \frac {\cos ^4(e+f x) (A+B \sin (e+f x))}{(c-c \sin (e+f x))^3} \, dx\\ &=\frac {a^2 (A+B) c^2 \cos ^5(e+f x)}{f (c-c \sin (e+f x))^3}-\left (a^2 (2 A+3 B) c\right ) \int \frac {\cos ^4(e+f x)}{(c-c \sin (e+f x))^2} \, dx\\ &=\frac {a^2 (A+B) c^2 \cos ^5(e+f x)}{f (c-c \sin (e+f x))^3}+\frac {a^2 (2 A+3 B) \cos ^3(e+f x)}{2 f (c-c \sin (e+f x))}-\frac {1}{2} \left (3 a^2 (2 A+3 B)\right ) \int \frac {\cos ^2(e+f x)}{c-c \sin (e+f x)} \, dx\\ &=\frac {3 a^2 (2 A+3 B) \cos (e+f x)}{2 c f}+\frac {a^2 (A+B) c^2 \cos ^5(e+f x)}{f (c-c \sin (e+f x))^3}+\frac {a^2 (2 A+3 B) \cos ^3(e+f x)}{2 f (c-c \sin (e+f x))}-\frac {\left (3 a^2 (2 A+3 B)\right ) \int 1 \, dx}{2 c}\\ &=-\frac {3 a^2 (2 A+3 B) x}{2 c}+\frac {3 a^2 (2 A+3 B) \cos (e+f x)}{2 c f}+\frac {a^2 (A+B) c^2 \cos ^5(e+f x)}{f (c-c \sin (e+f x))^3}+\frac {a^2 (2 A+3 B) \cos ^3(e+f x)}{2 f (c-c \sin (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.30, size = 191, normalized size = 1.63 \[ \frac {a^2 (\sin (e+f x)+1)^2 \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right ) (6 (2 A+3 B) (e+f x)-4 (A+3 B) \cos (e+f x)-B \sin (2 (e+f x)))-\sin \left (\frac {1}{2} (e+f x)\right ) (-4 (A+3 B) \cos (e+f x)+4 A (3 e+3 f x+8)+2 B (9 e+9 f x+16)-B \sin (2 (e+f x)))\right )}{4 c f (\sin (e+f x)-1) \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.43, size = 177, normalized size = 1.51 \[ \frac {B a^{2} \cos \left (f x + e\right )^{3} - 3 \, {\left (2 \, A + 3 \, B\right )} a^{2} f x + 2 \, {\left (A + 3 \, B\right )} a^{2} \cos \left (f x + e\right )^{2} + 8 \, {\left (A + B\right )} a^{2} - {\left (3 \, {\left (2 \, A + 3 \, B\right )} a^{2} f x - {\left (10 \, A + 13 \, B\right )} a^{2}\right )} \cos \left (f x + e\right ) + {\left (3 \, {\left (2 \, A + 3 \, B\right )} a^{2} f x + B a^{2} \cos \left (f x + e\right )^{2} - {\left (2 \, A + 5 \, B\right )} a^{2} \cos \left (f x + e\right ) + 8 \, {\left (A + B\right )} a^{2}\right )} \sin \left (f x + e\right )}{2 \, {\left (c f \cos \left (f x + e\right ) - c f \sin \left (f x + e\right ) + c f\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 163, normalized size = 1.39 \[ -\frac {\frac {3 \, {\left (2 \, A a^{2} + 3 \, B a^{2}\right )} {\left (f x + e\right )}}{c} + \frac {16 \, {\left (A a^{2} + B a^{2}\right )}}{c {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}} + \frac {2 \, {\left (B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 6 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 2 \, A a^{2} - 6 \, B a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )}^{2} c}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.43, size = 299, normalized size = 2.56 \[ -\frac {8 a^{2} A}{f c \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}-\frac {8 a^{2} B}{f c \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}-\frac {a^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) B}{f c \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {2 a^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) A}{f c \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {6 a^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) B}{f c \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {a^{2} B \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f c \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {2 a^{2} A}{f c \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {6 a^{2} B}{f c \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}-\frac {9 a^{2} \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) B}{f c}-\frac {6 a^{2} \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) A}{f c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.48, size = 624, normalized size = 5.33 \[ -\frac {2 \, A a^{2} {\left (\frac {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 2}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {c \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {c \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c}\right )} + 4 \, B a^{2} {\left (\frac {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 2}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {c \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {c \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c}\right )} + B a^{2} {\left (\frac {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {5 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {3 \, \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {3 \, \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} - 4}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {2 \, c \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {2 \, c \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {c \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} - \frac {c \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}}} + \frac {3 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c}\right )} + 4 \, A a^{2} {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c} - \frac {1}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} + 2 \, B a^{2} {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c} - \frac {1}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} - \frac {2 \, A a^{2}}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 14.70, size = 244, normalized size = 2.09 \[ \frac {10\,A\,a^2-\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,A\,a^2+5\,B\,a^2\right )+14\,B\,a^2-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (2\,A\,a^2+7\,B\,a^2\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (8\,A\,a^2+9\,B\,a^2\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (18\,A\,a^2+21\,B\,a^2\right )}{f\,\left (-c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4-2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-c\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\right )}-\frac {3\,a^2\,\mathrm {atan}\left (\frac {3\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,A+3\,B\right )}{6\,A\,a^2+9\,B\,a^2}\right )\,\left (2\,A+3\,B\right )}{c\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 8.09, size = 2365, normalized size = 20.21 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________